<script setup lang="ts">
import { getClassMemberList } from '@/api/class';
import type { ClassMember } from '@/api/class/type';
import { onMounted, ref } from 'vue';

const id = ref('');
const dataList = ref([] as ClassMember[]);

onMounted(() => {
    getClassMemberList(id.value).then((res) => {
        dataList.value = res.data;
    });
})

</script>

<template>
    <div class="container">
        <el-table :data="dataList" style="width: 100%" stripe border>
            <el-table-column prop="id" label="班级ID" />
            <el-table-column prop="name" label="班级名" />
            <el-table-column prop="joined" label="加入时间" />
        </el-table>
    </div>
</template>